-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters 
-- command (Ctrl-Shift-M) to fill in the parameter 
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE InsertWorkDate
	-- Add the parameters for the stored procedure here
@organNo nvarchar(20),
	@empNo nvarchar(20),
	@workDate numeric(8,0),
	@timetableNo numeric(3,0),
	@timetableExFrom numeric(8,0),
	@timetableExTo numeric(8,0),
	@workContract numeric(4,0)
	
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
    INSERT INTO WORK_DATA(WORK_DATE, ORGANIZATIONAL_NO, EMPLOYEE_NO, TIME_TABLE_NO, 
						  EXPIRATION_FROM, EXPIRATION_TO, WORK_TYPE_NO, WORK_DAYS, 
						  CREATE_DATE_TIME, UPDATE_DATE_TIME, CONTRACT_TIME)
	VALUES(@workDate, @organNo, @empNo, @timetableNo, @timetableExFrom, @timetableExTo,
			1, 0.0, GETDATE(), GETDATE(), @workContract)
	
END
GO
